<?php declare(strict_types=1);


namespace PinWuYun\domain\dao;



use PinWuYun\domain\models\GoodsSkuRelationModel;

/**
 * Created: by zhiJie
 * Date: 2021/7/1
 */
class GoodsSkuReleaseDao
{
    /**
     *  保存一条数据
     * @param array $params
     * @return bool
     */
    public static function inset(array $params): bool
    {
        $model = new GoodsSkuRelationModel();
        $model->setRawAttributes([
            'item_id' => $params['item_id'],
            'you_sku_id' => $params['you_sku_id'],
            'code' => $params['code'],
        ]);
        return $model->save();
    }

    /**
     * 批量插入
     * @param array $attributesList
     * @return bool
     */
    public static function batchInsert(array $attributesList): bool
    {
        return (new GoodsSkuRelationModel)->saveAll($attributesList);

    }
}